<template>
  <div>
    <!-- 三级分类导航 -->
    <TypeNav />
    <!-- 列表 -->
    <ListContainer />
    <!-- 今日推荐 -->
    <Recommend />
    <!-- 商品排行 -->
    <Rank />
    <!-- 喜欢 -->
    <Like />
    <!-- 楼层   为了复用组件在父组件中进行发送请求-->
    <Floor v-for="floors in floorsList" :key="floors.id" :floors="floors" />

    <!-- 商标 -->
    <Brand />
  </div>
</template>

<script>
import TypeNav from "./TypeNav";
import ListContainer from "./ListContainer";
import Recommend from "./Recommend";
import Rank from "./Rank";
import Like from "./Like";
import Floor from "./Floor";
import Brand from "./Brand";

import { reqGetFloorsList } from "@/api/axios/home";
export default {
  name: "XHome",
  components: { ListContainer, Recommend, Rank, Like, Floor, Brand, TypeNav },
  // 发送获取楼层数据
  async mounted() {
    const result = await reqGetFloorsList();
    this.floorsList = result;
  },
  data() {
    return {
      floorsList: {},
    };
  },
};
</script>
